<form class="form" id="editHandlePermission" method="post" responseType="JSON" action="${ctx}/sysHandlePermissionsController/saveOrUpdate.do"
      data-bv-submitButtons="#saveHandlePermission"
      data-bv-message="This value is not valid"
      data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
      data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
      data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
    <input type="hidden" name="formKey" value="${formKey}">
    <input type="hidden" name="formToken" value="${formToken}">
    <#if copy?string("yes","no")=="no">
        <input type="hidden" name="id" value="${bean.id?html}">
    </#if>
    <input type="hidden" name="menuId" value="${bean.menuId}">
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="sr-only">操作权限名称</label>
                <input type="text" class="form-control" name="name" placeholder="操作权限名称" required="required" value="${bean.name}" data-bv-message="The field is not valid">
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="sr-only">页面名称</label>
                <input type="text" class="form-control" name="pageName" placeholder="页面名称"  value="${bean.pageName?html}">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="sr-only">标签元素</label>
                <input type="text" class="form-control" name="tagName" placeholder="标签元素" required="required" value="${bean.tagName?html}">
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="sr-only">内部html</label>
                <input type="text" class="form-control" name="innerHtml" placeholder="内部html" value="${bean.innerHtml?html}">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="sr-only">编码</label>
                <input type="text" class="form-control" name="code" placeholder="编码" required="required" value="${bean.code?html}">
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="sr-only">ID属性</label>
                <input type="text" class="form-control" name="idAttr" placeholder="ID属性" value="${bean.idAttr?html}">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="sr-only">权重</label>
                <div class="spinner handlePermissionWeight">
                    <input type="text" class="spinner-input form-control" min="1"  maxlength="3"name="weight" placeholder="权重" required="required" value="${bean.weight?html}">
                    <div class="spinner-buttons	btn-group btn-group-vertical">
                        <button type="button" class="btn spinner-up blue">
                            <i class="fa fa-chevron-up"></i>
                        </button>
                        <button type="button" class="btn spinner-down darkorange">
                            <i class="fa fa-chevron-down"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-6">
            <div class="form-group">
                <label for="isForbidden" class="col-sm-2 control-label no-padding-right">禁用</label>
                <div class="col-sm-10">
                    <input type="hidden" name="isForbidden" value="${bean.isForbidden?html}">
                    <label>
                        <input  data-target-input-name="isForbidden" data-bv-message="The field is not valid"maxlength="1" alt="是否禁用" id="isForbidden" placeholder="是否禁用" type="checkbox" title="是否禁用" class="form-control checkbox-slider slider-icon yesno"   ${(bean.isForbidden???string(bean.isForbidden?string('checked',''),''))!''}>
                        <span class="text"></span>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <button type="submit" class="btn btn-success shiny" id="saveHandlePermission">
        <i class="fa fa-save"></i><span id="shpBtn">保存</span>
    </button>
</form>
<script>
    //初始化表单验证
    inintValidatorForm($("#editHandlePermission"));

    $(".handlePermissionWeight").spinner({
        value:"${bean.weight}"
    });
    //新增操作权限表单提交回调
    $("#editHandlePermission").on("ajaxSubmitCallback",function(event,data){
        console.log(data)
        if(data.resCode==200){
            bootbox.hideAll();
        }else{
            ajaxError(data.resMsg);
        }
    });
</script>